// pages/person/fenxiao/fenxiaoDetail/fenxiaoDetail.js
// pages/person/fenxiao/fenxiao.js
const app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    uid: '',
    list: [],
    page: 1
  },
  load() {
    let that=this
    wx.request({
      url: app.globalData.api + "mycustomer",
      data: {
        uid: that.data.uid,
        page: that.data.page
      },
      success: (res) => {
        console.log(res)
        if (res.data.list.length == 0 && res.data.code == 0) {
          wx.showToast({
            title: '已经到底了',
          })
        } else {
          that.setData({
            list: that.data.list.concat(res.data.list),
            page: ++that.data.page
          })
        }
      },
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  let that=this
    let uid=options.uid
    that.setData({
      uid: uid
    })
   that.load()

  },

  // detailInto: function (e) {
  //   console.log(e)
  //   wx.navigateTo({
  //     url: '/pages/person/fenxiao/fenxiaoDetail/fenxiaoDetail',
  //   })
  // },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    let that=tis
    that.load()
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})